﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace University.Workshop.DataAccess
{
    public static class DataAccessConfiguration
    {
        public static ICollection<Model.AppConfiguration> GetCurrent()
        { 
            WFPEntities.Instance.DiscardChanges();
            return(from c in WFPEntities.Instance.Configurations
                    orderby c.Id descending
                    select c).ToList();
        }

        public static void Insert(Model.AppConfiguration config)
        {
            WFPEntities.Instance.DiscardChanges();
            WFPEntities.Instance.Configurations.Add(config);
            WFPEntities.Instance.SaveChanges();
        }
    }
}
